using System;
using System.Collections.Generic;

namespace SharpFastCGI
{
	public interface IApplication
	{
		/// <summary>
		/// Runs the CGI application.
		/// </summary>
		/// <param name="Environment">
		/// A <see cref="IDictionary`2"/> containing the environment variables.
		/// </param>
		/// <param name="Stdin">
		/// A <see cref="InputStream"/> to read from the standard input.
		/// </param>
		/// <param name="Stdout">
		/// A <see cref="OutputStream"/> to write to the standard output.
		/// </param>
		/// <param name="Stderr">
		/// A <see cref="OutputStream"/> to write to the standard error.
		/// </param>
		/// <returns>
		/// The exit code.
		/// </returns>
		/// <remarks>
		/// You shall not use the provided arguments once the method has returned.
		/// Indeed, those objects will be reused for following requests for
		/// performance reasons.
		/// </remarks>
		int Run(
		        IDictionary<string,string> Environment,
		        InputStream Stdin,
		        OutputStream Stdout,
		        OutputStream Stderr);
	}
}
